package keter.starter.demo.config;

import keter.starter.demo.Demo;
import keter.starter.service.impl.DemoServiceProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author hourui 2017/10/10 16:29
 */
@Configuration
public class DemoAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public Demo init() {
        Demo demo = new Demo();
        return demo;
    }

    /**
     * 使注解功能生效
     * @return
     */
    @ConditionalOnMissingBean
    @Bean
    public DemoServiceProcessor serviceDiscoverer() {
        return new DemoServiceProcessor();
    }
}
